####################
##### COLOURS ######
####################

BACKGROUND=colour8

# tmux-256 color makes my dir colors work, but breaks the S-Tab sequence I use for UltiSnips...
# manually setting "export term=xterm-256color" within tmux, before launching
# vim, fixes this... extremely hackish

set -g default-terminal "xterm-256color"
# set -g default-terminal "xterm"
# set -g default-terminal "screen-256color"
# set -g default-terminal "tmux-256color"

# enable true color support (this took forever to find)
# https://deductivelabs.com/blog/tech/using-true-color-vim-tmux/
set-option -ga terminal-overrides ",xterm-256color:Tc"


# set a larger scrollback buffer size
set-option -g history-limit 10000

# default statusbar colors
set-option -g status-bg default  #note the invisible ink, colour15
set-option -g status-fg yellow

# set window title list colors
set-window-option -g window-status-style fg=brightblue,bg=$BACKGROUND #note the invisible ink, colour15
#set-window-option -g window-status-style fg=brightblue #note the invisible ink, colour15

# active window title colors
set-window-option -g window-status-current-style fg=brightred,bg=$BACKGROUND
#set-window-option -g window-status-current-style fg=brightred

# active window colors; these are the basic text/background colours,
# but are only used when multiple panes are open
# old format
# set -g window-active-style "bg=colour0"
# set -g window-style "bg=colour8"

# window indicators w/ ctrl-q
# old format
# set-window-option -g window-status-fg brightblue
# set-window-option -g window-status-bg colour0

# window indicators w/ ctrl-q when splits
# old format
#set-window-option -g window-status-current-fg brightred
# set-window-option -g window-status-current-bg colour0
# new format
set-window-option -g window-status-current-style fg=brightred
#set-window-option -g window-status-current-style bg=colour0

# pane border
# old format
#set-option -g pane-border-fg colour0
#set-option -g pane-active-border-fg yellow
# new format
set-option -g pane-active-border-style fg=colour0

# message text
# old format
#set-option -g message-bg colour0
#set-option -g message-fg brightred
# new format
set-option -g message-style bg=colour0
set-option -g message-style fg=brightred

# pane number display
set-option -g display-panes-active-colour blue
set-option -g display-panes-colour brightred

# clock
set-window-option -g clock-mode-colour yellow

# don't auto-rename windows
 set-option -g allow-rename off
####################

# start new windows at the current path
bind c new-window       -c "#{pane_current_path}"
bind '"' split-window   -c "#{pane_current_path}"
bind s split-window     -c "#{pane_current_path}"
bind % split-window     -h -c "#{pane_current_path}"
bind v split-window     -h -c "#{pane_current_path}"

# resize panes
bind j resize-pane -D 5
bind k resize-pane -U 5
bind h resize-pane -L 5
bind l resize-pane -R 5

# Start windows and panes at 1, not 0
set -g base-index 1
setw -g pane-base-index 1

# increase status bar left element; was too narrow
set -g status-left-length 20
# set -g status-right-length 50
set -g status-right  " %H:%M %d-%b#(acpi | cut -d ',' -f 2)"

# use S/V to join panes interactively
bind-key S choose-window 'join-pane -v -s "%%"'
bind-key V choose-window 'join-pane -h -s "%%"'

# remap prefix
unbind C-b
set-option -g prefix C-Space
#bind-key 125 send-prefix
